<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<h:head>
<title>User</title>
	<link type="text/css" rel="stylesheet" href="css/dth.css" />
	<style>
.menu7 {
	box-shadow: 6px 11px 10px;
}

.admin_menu_user {
	background: #0FD1D1 !important;
}

.myTable td:nth-child(6) {
	width: 50px;
	text-align: center;
}
</style>
</h:head>

<h:body>
	<p:ajaxStatus
		style="bottom: 68%;
	    height: 32px;
	    position: fixed;
	    right: 50%;
	    width: 32px;
	    z-index: 99999;">
		<f:facet name="start">
			<p:graphicImage value="images/loading.gif" />
		</f:facet>

		<f:facet name="complete">
			<h:outputText value="" />
		</f:facet>
	</p:ajaxStatus>
	<p:growl id="growl" showDetail="true" sticky="false" />
	<ui:insert name="header">
		<ui:include src="/header/header_dth.xhtml" />
	</ui:insert>
	<div>
		<div class="dth_body_home">
			<ui:insert name="header_banner">
				<ui:include src="/header/header_banner.xhtml" />
			</ui:insert>
			<div class="dth_content">
				<div class="dth_admin_menu">
					<h:form>


						<ui:insert name="header_banner">
							<ui:include src="/header/menu_admin.xhtml" />
						</ui:insert>

					</h:form>
				</div>
				<div class="dth_content_admin">
					<div class="menu_top1">
						<h:form id="dlgform">
							<p:dialog header="insert user" widgetVar="dlg" id="dlg"
								width="500" height="auto" resizable="false">
								<ui:insert name="header_banner">
									<ui:include src="/include/user_input.xhtml" />
								</ui:insert>
							</p:dialog>
						</h:form>
						<h:form id="form_confirm_delete_user">
							<p:confirmDialog id="confirm_delete_user"
								message="Bạn có thực sự muốn xóa?" header="Xóa user" width="400"
								showEffect="clip" closable="false" widgetVar="confirm_del_user">
								<h:panelGroup id="data">
									<h:inputHidden value="#{userBean.id}"></h:inputHidden>
									<div class="feild-action">
										<p:commandButton value="Có" action="#{userBean.delete()}"
											oncomplete="confirm_del_user.hide()"></p:commandButton>
										<p:commandButton value="Không"
											onclick="confirm_del_user.hide()"></p:commandButton>
									</div>
								</h:panelGroup>


							</p:confirmDialog>
						</h:form>
						<h:form>
							<p:commandButton onclick="dlg.show()" title="insert"
								icon="ui-icon ui-icon-plusthick" update=":dlgform:dlgisert"></p:commandButton>
							<h:outputText value="User"
								style="margin-left:5px;font-size: 20px;font-weight: bold;"></h:outputText>
						</h:form>
					</div>
					<div class="dth_admin_main">
						<h:panelGroup id="mainform">
							<p:dataTable styleClass="myTable" var="item" paginator="true"
								rows="15" paginatorPosition="bottom"
								paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
								value="#{userBean.listUser}" rowIndexVar="row">
								<p:column headerText="Stt">
									<h:outputText value="#{row+1}" />
								</p:column>
								<p:column headerText="Name">
									<h:outputText style="float:left;" value="#{item.customerName}">
									</h:outputText>
								</p:column>
								<p:column headerText="Card Number">
									<h:outputText style="float:left;" value="#{item.cardNumber}">
									</h:outputText>
								</p:column>
								<p:column headerText="Email Address">
									<h:outputText style="float:left;" value="#{item.emailAddress}">
									</h:outputText>
								</p:column>
								<p:column headerText="Address">
									<h:outputText style="float:left;" value="#{item.address}">
									</h:outputText>
								</p:column>
								<p:column headerText="Service Subscribe Date">
									<h:outputText style="float:left;"
										value="#{item.serviceSubcribeDate}">
									</h:outputText>
								</p:column>
								<p:column headerText="Action">
									<h:form style="text-align: center;">
										<p:commandLink onclick="confirm_del_user.show()"
											update=":form_confirm_delete_user:data">
											<f:param value="delete" name="action"></f:param>
											<f:param value="#{item.customerId}" name="customer_id"></f:param>
											<img src="images/icon_delete.png" title="Delete" />
										</p:commandLink>
										<p:commandLink onclick="dlg.show()" update=":dlgform:dlgisert">
											<f:param value="update" name="action"></f:param>
											<f:param value="#{item.customerId}" name="customer_id"></f:param>
											<img src="images/icon_edit.png" title="Edit" />
										</p:commandLink>
										<h:outputLink value="package_history.xhtml"
											style="text-decoration: none !important;">
											<img src="images/packge_history.png"
												title="user 's package suggested" />
											<f:param name="user_id" value="#{item.customerId}"></f:param>
										</h:outputLink>
									</h:form>

								</p:column>
							</p:dataTable>
						</h:panelGroup>
					</div>
				</div>
			</div>
		</div>
	</div>
	<ui:insert name="header">
		<ui:include src="/footer/footer_dth.xhtml" />
	</ui:insert>

</h:body>
</html>